﻿// Fill out your copyright notice in the Description page of Project Settings.
#include "SmartMaterialExpressionExtensions.h"

TArray<FString> USmartMaterialExpressionExtensions::SmGetAllOutputName(UMaterialExpression* Expression)
{
	TArray<FString> Result;
	for (int OutIdx = 0; OutIdx < Expression->Outputs.Num(); OutIdx++)
	{
		FExpressionOutput& Output = Expression->Outputs[OutIdx];
		// If output name is no empty - see if it matches
		if(!Output.OutputName.IsNone())
		{	Result.Add(Output.OutputName.ToString());
		}
	}
	return Result;
}

TArray<FString> USmartMaterialExpressionExtensions::SmGetAllInputName(UMaterialExpression* Expression)
{
	TArray<FString> Result;
	TArray<FExpressionInput*> Inputs = Expression->GetInputs();
	for (const FExpressionInput*  Input: Inputs)
	{
		if(!Input->InputName.IsNone())
		{	Result.Add(Input->InputName.ToString());
		}
	}
	return Result;
}
